package cn.wuxing.mediation.web.controller.contradiction;

import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import cn.wuxing.mediation.system.domain.StgMplcHzZzEventDiWxq;
import cn.wuxing.mediation.system.service.IStgMplcHzZzEventDiWxqService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.wuxing.mediation.common.annotation.Log;
import cn.wuxing.mediation.common.core.controller.BaseController;
import cn.wuxing.mediation.common.core.domain.AjaxResult;
import cn.wuxing.mediation.common.enums.BusinessType;
import cn.wuxing.mediation.common.utils.poi.ExcelUtil;
import cn.wuxing.mediation.common.core.page.TableDataInfo;

/**
 * 110双非警情Controller
 *
 * @author mediation
 * @date 2024-09-28
 */
@RestController
@RequestMapping("/cm/wxq")
public class CmMplcHzZzEventDiWxqController extends BaseController
{

    @Resource
    private IStgMplcHzZzEventDiWxqService stgMplcHzZzEventDiWxqService;

    /**
     * 查询110双非警情列表
     */
    @PreAuthorize("@ss.hasPermi('cm:wxq:list')")
    @GetMapping("/list")
    public TableDataInfo list(StgMplcHzZzEventDiWxq stgMplcHzZzEventDiWxq)
    {
        startPage();
        List<StgMplcHzZzEventDiWxq> list = stgMplcHzZzEventDiWxqService.selectStgMplcHzZzEventDiWxqList(stgMplcHzZzEventDiWxq);
        return getDataTable(list);
    }

    /**
     * 导出110双非警情列表
     */
    @PreAuthorize("@ss.hasPermi('cm:wxq:export')")
    @Log(title = "110双非警情", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, StgMplcHzZzEventDiWxq stgMplcHzZzEventDiWxq)
    {
        List<StgMplcHzZzEventDiWxq> list = stgMplcHzZzEventDiWxqService.selectStgMplcHzZzEventDiWxqList(stgMplcHzZzEventDiWxq);
        ExcelUtil<StgMplcHzZzEventDiWxq> util = new ExcelUtil<StgMplcHzZzEventDiWxq>(StgMplcHzZzEventDiWxq.class);
        util.exportExcel(response, list, "110双非警情数据");
    }

    /**
     * 获取110双非警情详细信息
     */
    @PreAuthorize("@ss.hasPermi('cm:wxq:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(stgMplcHzZzEventDiWxqService.selectStgMplcHzZzEventDiWxqById(id));
    }

    /**
     * 新增110双非警情
     */
    @PreAuthorize("@ss.hasPermi('cm:wxq:add')")
    @Log(title = "110双非警情", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody StgMplcHzZzEventDiWxq stgMplcHzZzEventDiWxq)
    {
        return toAjax(stgMplcHzZzEventDiWxqService.insertStgMplcHzZzEventDiWxq(stgMplcHzZzEventDiWxq));
    }

    /**
     * 修改110双非警情
     */
    @PreAuthorize("@ss.hasPermi('cm:wxq:edit')")
    @Log(title = "110双非警情", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody StgMplcHzZzEventDiWxq stgMplcHzZzEventDiWxq)
    {
        return toAjax(stgMplcHzZzEventDiWxqService.updateStgMplcHzZzEventDiWxq(stgMplcHzZzEventDiWxq));
    }

    /**
     * 删除110双非警情
     */
    @PreAuthorize("@ss.hasPermi('cm:wxq:remove')")
    @Log(title = "110双非警情", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(stgMplcHzZzEventDiWxqService.deleteStgMplcHzZzEventDiWxqByIds(ids));
    }

    //    @Autowired
//    private ICmMplcHzZzEventDiWxqService cmMplcHzZzEventDiWxqService;
//
//    /**
//     * 查询110双非警情列表
//     */
//    @PreAuthorize("@ss.hasPermi('cm:wxq:list')")
//    @GetMapping("/list")
//    public TableDataInfo list(CmMplcHzZzEventDiWxq cmMplcHzZzEventDiWxq)
//    {
//        startPage();
//        List<CmMplcHzZzEventDiWxq> list = cmMplcHzZzEventDiWxqService.selectCmMplcHzZzEventDiWxqList(cmMplcHzZzEventDiWxq);
//        return getDataTable(list);
//    }
//
//    /**
//     * 导出110双非警情列表
//     */
//    @PreAuthorize("@ss.hasPermi('cm:wxq:export')")
//    @Log(title = "110双非警情", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, CmMplcHzZzEventDiWxq cmMplcHzZzEventDiWxq)
//    {
//        List<CmMplcHzZzEventDiWxq> list = cmMplcHzZzEventDiWxqService.selectCmMplcHzZzEventDiWxqList(cmMplcHzZzEventDiWxq);
//        ExcelUtil<CmMplcHzZzEventDiWxq> util = new ExcelUtil<CmMplcHzZzEventDiWxq>(CmMplcHzZzEventDiWxq.class);
//        util.exportExcel(response, list, "110双非警情数据");
//    }
//
//    /**
//     * 获取110双非警情详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('cm:wxq:query')")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") String id)
//    {
//        return success(cmMplcHzZzEventDiWxqService.selectCmMplcHzZzEventDiWxqById(id));
//    }
//
//    /**
//     * 新增110双非警情
//     */
//    @PreAuthorize("@ss.hasPermi('cm:wxq:add')")
//    @Log(title = "110双非警情", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody CmMplcHzZzEventDiWxq cmMplcHzZzEventDiWxq)
//    {
//        return toAjax(cmMplcHzZzEventDiWxqService.insertCmMplcHzZzEventDiWxq(cmMplcHzZzEventDiWxq));
//    }
//
//    /**
//     * 修改110双非警情
//     */
//    @PreAuthorize("@ss.hasPermi('cm:wxq:edit')")
//    @Log(title = "110双非警情", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody CmMplcHzZzEventDiWxq cmMplcHzZzEventDiWxq)
//    {
//        return toAjax(cmMplcHzZzEventDiWxqService.updateCmMplcHzZzEventDiWxq(cmMplcHzZzEventDiWxq));
//    }
//
//    /**
//     * 删除110双非警情
//     */
//    @PreAuthorize("@ss.hasPermi('cm:wxq:remove')")
//    @Log(title = "110双非警情", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{ids}")
//    public AjaxResult remove(@PathVariable String[] ids)
//    {
//        return toAjax(cmMplcHzZzEventDiWxqService.deleteCmMplcHzZzEventDiWxqByIds(ids));
//    }
}
